﻿// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.
function ajaxSubmit(form, url, callback = null, method = "POST") {
    $.ajax({
        url: url,
        async: false,
        type: method,
        data: $('#' + form).serialize(),
        success: function (data) {
            // alert(JSON.stringify(data));
            // var result = JSON.parse(data);
            if (callback != null) {
                callback(data)
            }
        }
    });
}